package hn.cch.spring_boot_security_rest.wrapper;

import javax.servlet.ReadListener;
import javax.servlet.ServletInputStream;
import java.io.ByteArrayInputStream;
import java.io.IOException;

public class ApiServletInputStream extends ServletInputStream {


    private ByteArrayInputStream bais = null;

    public ApiServletInputStream(ByteArrayInputStream bais) {
        this.bais = bais;
    }

    @Override
    public boolean isFinished() {
        return false;
    }

    @Override
    public boolean isReady() {
        return false;
    }

    @Override
    public void setReadListener(ReadListener readListener) {

    }

    @Override
    public int read() throws IOException {
        return bais.read();
    }
}
